<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#prescDrrug").submit();
        return false;
    }

    function drugDispRecPrint() {
        var startTime = $("#startDate").val();
        var endTime = $("#endTime").val();
        printPdf('/nurse/prescDurgClassPrint','startTime='+startTime+'&endTime='+endTime);
    }

</script>
    <!-- content wrapper -->
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li><a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/nurse/index')">床位列表</a></li>
                <li class="">
                    <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/nurse/prescPatDrug?type=1')">摆药查询（个人）</a>
                </li>
                <li class="active">
                    <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/nurse/prescPatDrug?type=2')">摆药查询（药品）</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                                <form:form id="prescDrrug" modelAttribute="drugDispRec" onsubmit="return loadDivForm('mainCenterDiv','prescDrrug','${ctx}/nurse/prescDurgClass');" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <label>日期：</label>
                                    <form:input path="startTime" id="startDate" htmlEscape="false"  class="form-control Wdate"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
                                    至
                                    <form:input path="endTime" id="endTime"  htmlEscape="false" class="form-control Wdate"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
                                    <input name="date" id="week" class="btn btn-default" type="button" value="一周内" onclick="dateCondition('week',-7,'startDate')"/>
                                    <input name="date" id="halfMonth" class="btn btn-default" type="button" value="半月内" onclick="dateCondition('halfMonth',-15,'startDate')"/>
                                    <input name="date"  id="month" class="btn btn-default" type="button" value="一个月内" onclick="dateCondition('month',-30,'startDate')"/>
                                    &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                    &nbsp;&nbsp;<input id="btnSubmit" onclick="drugDispRecPrint()" class="btn btn-primary" type="button" value="打印"/>
                                </form:form>
                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered mg-t datatable">
                            <thead>
                            <tr>
                                <th>摆药名称</th>
                                <th>规格</th>
                                <th>数量</th>
                                <th>单位</th>
                                <th>医嘱数目</th>
                                <th>金额</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="drugDis">
                            <tr>
                                <td>${drugDis.orderText}</td>
                                <td>${drugDis.drugSpec}</td>
                                <td>${drugDis.amount}</td>
                                <td>${fns:getDictLabels(drugDis.drugUnits, 'SPEC_UNIT', '')}</td>
                                <td>${drugDis.count}</td>
                                <td>${drugDis.costs}</td>
                            </tr>
                            </c:forEach>
                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>